package com.geekathon.mobzilla.model;

public enum Severity {

	BLOCKER(1), CRITICAL(2), MAJOR(3), NORMAL(4), MINOR(5), TRIVIAL(6), ENHANCEMENT(
			7);

	int value;

	private Severity(int severity) {
		value = severity;
	}

	public int getValue() {
		return value;
	}

	@Override
	public String toString() {
		return String.valueOf(value);
	}

	public static int getEnumFromString(String str) {
		if (str.toLowerCase().equals("BLOCKER")) {
			return 1;
		}
		if (str.toLowerCase().equals("CRITICAL")) {
			return 2;
		}
		if (str.toLowerCase().equals("MAJOR")) {
			return 3;
		}
		if (str.toLowerCase().equals("NORMAL")) {
			return 4;
		}
		if (str.toLowerCase().equals("MINOR")) {
			return 5;
		}
		if (str.toLowerCase().equals("TRIVIAL")) {
			return 6;
		}
		if (str.toLowerCase().equals("ENHANCEMENT")) {
			return 7;
		}

		return 0;

	}

}
